import request from '@/utils/request'

// 获取工单类型下拉列表
export function getWorkOrderTypeList() {
  return request({
    url: '/operation/web/operationWorkOrderPermission/workOrderTypeList',
    method: 'get'
  })
}

// 获取用户类型下拉列表
export function getUserTypeList() {
  return request({
    url: '/operation/web/operationWorkOrderPermission/userTypeList',
    method: 'get'
  })
}

// 获取所有用户下拉列表
export function getUserList() {
  return request({
    url: '/operation/web/operationWorkOrderPermission/userList',
    method: 'get'
  })
}

// 查询工单权限配置信息列表
export function getWorkOrderPermissionList(params) {
  return request({
    url: '/operation/web/operationWorkOrderPermission/list',
    method: 'get',
    params
  })
}

// 新增工单权限配置信息
export function addWorkOrderPermission(data) {
  return request({
    url: '/operation/web/operationWorkOrderPermission',
    method: 'post',
    data
  })
}

// 修改工单权限配置信息
export function updateWorkOrderPermission(data) {
  return request({
    url: '/operation/web/operationWorkOrderPermission',
    method: 'put',
    data
  })
}

// 批量设置工单权限配置信息
export function batchSetWorkOrderPermission(data) {
  return request({
    url: '/operation/web/operationWorkOrderPermission/batch',
    method: 'post',
    data
  })
}

// 删除工单权限配置信息
export function deleteWorkOrderPermission(permissionIds) {
  return request({
    url: `/operation/web/operationWorkOrderPermission/${permissionIds}`,
    method: 'delete'
  })
}

// 获取所有用户下拉列表
export function getUserSelect() {
  return request({
    url: '/operation/web/operationWorkOrderPermission/userList',
    method: 'get'
  })
}